<html>
<head><meta charset="utf-8"><title>narrowing_rem · t-libs · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/index.html">t-libs</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/narrowing_rem.html">narrowing_rem</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="222159057"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/narrowing_rem/near/222159057" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Pratt <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/narrowing_rem.html#222159057">(Jan 09 2021 at 07:37)</a>:</h4>
<p>Hello there libs team! I was just wondering if there is any interest in the <a href="https://github.com/rust-lang/rust/issues/72762"><code>narrowing_rem</code></a> issue that was created a while back. I'd be interested in creating a pull request for this if it's something that might be accepted. If there's opposition for whatever reason, I'd obviously prefer not to spend time on it <span aria-label="smile" class="emoji emoji-1f642" role="img" title="smile">:smile:</span></p>



<a name="222188972"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/narrowing_rem/near/222188972" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/narrowing_rem.html#222188972">(Jan 09 2021 at 20:48)</a>:</h4>
<p>It's a good operation, but it's not obvious to me that it's best in <code>core</code> compared to being in <code>num</code> or similar -- with other useful things like <code>dev_ceil</code>.</p>



<a name="222189239"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/narrowing_rem/near/222189239" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/narrowing_rem.html#222189239">(Jan 09 2021 at 20:53)</a>:</h4>
<p>(Notably, it needs a trait, and the bar for having a new trait is higher.)</p>



<a name="222189502"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/narrowing_rem/near/222189502" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/narrowing_rem.html#222189502">(Jan 09 2021 at 20:58)</a>:</h4>
<p>I would love to have a way to be able to just add these as normal <code>Rem</code> implementations, but we can't do that these days because it has inference impact.  Maybe with chalk we'll be able to add some rules that will let us add them.</p>



<a name="222195946"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/narrowing_rem/near/222195946" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Pratt <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/narrowing_rem.html#222195946">(Jan 09 2021 at 23:58)</a>:</h4>
<p>Yeah, having better inference for ambiguous traits would be awesome, though I understand it's a ways off.</p>
<p>Off chance the bar for adding a trait is any different if said trait were sealed? Presumably not, but you never know. Regardless, this is something that could definitely be done in <code>num</code>, and is probably worth a pull request there. For better or for worse, that's probably not something I'll do, as I don't personally use that crate for anything.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>